# coding=utf-8

import openpyxl
from fpdf import FPDF
import os
# Excel_pdf 但无法全部成功
Workbooks = openpyxl.load_workbook(r"D:\zuu\cake\222.xlsx")

print(Workbooks)
# workbook = Workbooks.encode("utf-8").decode("latin-1")
Worksheet = Workbooks.active

pdf = FPDF()
pdf.add_page()

pdf.set_font('Arial',size=12)
for row in Worksheet.iter_rows():
    for cell in row:
#        cell_value = cell.value.encode("gbk").decode("gbk").encode("utf8")
        pdf.cell(100,10,str(cell),border=1)
pdf.output(r"D:\zuu\cake\222.pdf")
